package com.zx.cloud.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.zx.cloud.ApiVersion;
import com.zx.cloud.common.filter.IgnoreAuth;
import com.zx.cloud.model.request.ManagerLoginRequest;
import com.zx.cloud.model.response.ObjectDataResponse;

import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping(value = ApiVersion.API_V1_PREFIX + "/demo")
public class DemoController {

	private static final Logger logger = Logger.getLogger(DemoController.class);

	@IgnoreAuth
	@ApiOperation(value = "测试接口", notes = "测试接口")
	@RequestMapping(value = "/test", method = RequestMethod.GET)
	@ResponseBody
	public ObjectDataResponse<Boolean> test() {
		System.out.println("-------1--------------test---------------");
		return new ObjectDataResponse<Boolean>(true);
	}
	
	@IgnoreAuth
	@ApiOperation(value = "测试接口", notes = "测试接口")
	@RequestMapping(value = "/test2", method = RequestMethod.GET)
	@ResponseBody
	public ObjectDataResponse<Boolean> test2() {
		System.out.println("--------2-------------test---------------");
		return new ObjectDataResponse<Boolean>(true);
	}
	
	@IgnoreAuth
	@ApiOperation(value = "测试接口", notes = "测试接口")
	@RequestMapping(value = "/test3", method = RequestMethod.GET)
	@ResponseBody
	public ObjectDataResponse<Boolean> test3() {
		System.out.println("--------3-------------test---------------");
		return new ObjectDataResponse<Boolean>(true);
	}
	
	@IgnoreAuth
	@ApiOperation(value = "测试接口", notes = "测试接口")
	@RequestMapping(value = "/loginTest", method = RequestMethod.GET)
	@ResponseBody
	public ObjectDataResponse<Boolean> loginTest(HttpServletRequest request,HttpServletResponse response,@RequestBody ManagerLoginRequest loginRequest) {
		System.out.println("---------4------------test---------------");
		return new ObjectDataResponse<Boolean>(true);
	}
	
}
